package org.bling.star.common.model;

import org.bling.star.common.connect.CommandStreamKey;

import java.io.Serializable;
import java.util.List;

public class StreamMessage implements Serializable {
    private static final long serialVersionUID = -8783379936420245630L;
    private String streamName;
    private CommandStreamKey secretKey;
    private List<UserInfo> users;

    public StreamMessage() {
    }

    public String getStreamName() {
        return this.streamName;
    }

    public CommandStreamKey getSecretKey() {
        return this.secretKey;
    }

    public List<UserInfo> getUsers() {
        return this.users;
    }

    public void setStreamName(String streamName) {
        this.streamName = streamName;
    }

    public void setSecretKey(CommandStreamKey secretKey) {
        this.secretKey = secretKey;
    }

    public void setUsers(List<UserInfo> users) {
        this.users = users;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof StreamMessage)) return false;
        final StreamMessage other = (StreamMessage) o;
        if (!other.canEqual(this)) return false;
        final Object this$streamName = this.getStreamName();
        final Object other$streamName = other.getStreamName();
        if (this$streamName == null ? other$streamName != null : !this$streamName.equals(other$streamName))
            return false;
        final Object this$streamSecretKey = this.getSecretKey();
        final Object other$streamSecretKey = other.getSecretKey();
        if (this$streamSecretKey == null ? other$streamSecretKey != null : !this$streamSecretKey.equals(other$streamSecretKey))
            return false;
        final Object this$users = this.getUsers();
        final Object other$users = other.getUsers();
        return this$users == null ? other$users == null : this$users.equals(other$users);
    }

    protected boolean canEqual(final Object other) {
        return other instanceof StreamMessage;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $streamName = this.getStreamName();
        result = result * PRIME + ($streamName == null ? 43 : $streamName.hashCode());
        final Object $streamSecretKey = this.getSecretKey();
        result = result * PRIME + ($streamSecretKey == null ? 43 : $streamSecretKey.hashCode());
        final Object $users = this.getUsers();
        result = result * PRIME + ($users == null ? 43 : $users.hashCode());
        return result;
    }

    public String toString() {
        return "StreamMessage(streamName=" + this.getStreamName() + ", streamSecretKey=" + this.getSecretKey() + ", users=" + this.getUsers() + ")";
    }
}
